//
// Copyright (c) 2020 Intel Corporation
// Copyright (c) 2020 One Track Consulting
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package main

import (
	"app-webapi/comm/g"
	inits2 "app-webapi/comm/inits"
)

func main1() {
	//初始化一个全局log 格式化log输出
	inits2.InitLogger()
	// -p 目录 指定配置文件目录  用edgex 的sdk去加载配置 res目录下面的 configuration.toml
	ctx := inits2.AppClient()
	g.Logger.Info("初始化AppClient完成")
	go inits2.Route()
	inits2.Db()
	inits2.InfluxDB()
	g.Logger.Info("初始化DB完成")
	inits2.Table()
	g.Logger.Info("初始化Table完成")
	go inits2.Mqtt()
	//定时任务
	inits2.Cron()
	g.Logger.Info("初始化定时任务")

	<-ctx.Done()
}
